package com.wechat.servlet.Utils;

import java.io.UnsupportedEncodingException;
import java.util.Base64;


public class Base64Decoder {
    public static String decode(String encodeStr){
//        BASE64Decoder base64Decoder = new BASE64Decoder();

        Base64.Decoder decoder = Base64.getDecoder();
        byte[] bytes2 = new byte[0];
        bytes2 = decoder.decode(encodeStr);
        String decodeStr = null;
        try {
            decodeStr = new String(bytes2,"UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        System.out.println("解码: "+decodeStr);
        return decodeStr;
    }
}
